package org.springframework.core.type.classreading;

import java.util.ArrayList;
import java.util.List;

import org.springframework.asm.AnnotationVisitor;
import org.springframework.asm.SpringAsmInfo;
import org.springframework.asm.Type;
import org.springframework.core.type.ParameterMetadata;

public class StandardParameterMetadata extends AnnotationVisitor implements ParameterMetadata {
	/**
	 * 参数名
	 */
	protected String name;
	/**
	 * 参数所在的位置
	 */
	protected final int parameter;
	protected final Type type;
	protected final List<String> typeVariables = new ArrayList<String>();
	protected boolean isArrayType;
	protected String annotationDesc;
	protected boolean annotationVisible;

	public StandardParameterMetadata(int parameter, Type type) {
		super(SpringAsmInfo.ASM_VERSION);
		this.parameter = parameter;
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isArrayType() {
		return isArrayType;
	}

	public void setArrayType(boolean isArrayType) {
		this.isArrayType = isArrayType;
	}

	public String getAnnotationDesc() {
		return annotationDesc;
	}

	public void setAnnotationDesc(String annotationDesc) {
		this.annotationDesc = annotationDesc;
	}

	public boolean isAnnotationVisible() {
		return annotationVisible;
	}

	public void setAnnotationVisible(boolean annotationVisible) {
		this.annotationVisible = annotationVisible;
	}

	public int getParameter() {
		return parameter;
	}

	public Type getType() {
		return type;
	}

	public List<String> getTypeVariables() {
		return typeVariables;
	}

}
